home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / vegx20.zip / VGXSPECS.DOC < prev    next >
Text File  |  1990-11-15  |  4KB  |  104 lines

  1.                      VEGX FILE FORMAT SPECIFICATION
  2.                          
  3.                               May, 1990
  4.  
  5.  
  6.                             Dwain Goforth
  7.                           Milestone Software
  8.                            1260 Sunset Ave.
  9.                            Arcata, CA 95521
  10.  
  11.  
  12.  
  13. The VEGX file format uses a run-length encoding scheme for each of the 
  14. four video banks (or planes.)  Like BLOAD, it uses 64k EGA banks; like 
  15. PCX, it uses run-length encoding.  Each bank is one color attribute (red, 
  16. blue, green, intensity).  Compressing banks is more efficient than scan 
  17. lines - VEGX changes banks only 4 times for each file while PCX changes 
  18. 1920 times for a VGA 640x480 16-color image (four times each scan line.)  
  19.  
  20. Using VGXLoad or EGXLoad will add approximately 8k to your finished EXE 
  21. program.  Using VGXSave or EGXSave will add approximately 6k of compiled 
  22. code to your EXE program.
  23.  
  24. In addition to this compiled code, the routines will allocate additional 
  25. memory each time they are called.
  26.  
  27. While running, VGXSave will allocate 78k of RAM, while VGXLoad will
  28. need 56k of RAM.  EGXSave allocates about 72k of RAM while EGXLoad 
  29. allocates approximately 44k of RAM.  Please note that this used RAM 
  30. is released after each call (except for the xGXGRAB.COM TSR's which 
  31. allocate RAM permanently - until you re-boot your computer.)  
  32.  
  33. Most critical DOS errors are "passed through"; that is, if an error
  34. occurs (filename, disk or memory), the VEGX routines will pass
  35. control back to your program (the call may fail, but your program
  36. will not crash.)  However, you do have to have sufficient RAM
  37. available.  Remember that speed was the guiding criterion when 
  38. designing VEGX. If error catching is essential you will need to use 
  39. ON ERROR in your program.
  40.  
  41. VEGX will work with any IBM-compatible microcomputer with an EGA or 
  42. VGA display adapter.  DOS 2.1 and above are required.  Versions of 
  43. Microsoft BASIC supported are QuickBASIC 4.0 - 4.5 and BASIC 6.0 and 
  44. BASIC 7.0.
  45.  
  46.   *** Please remember that this is the first release of VEGX.    ***
  47.   *** Your reporting of bugs or incompatibilities will help me   ***
  48.   *** improve the product.                                       ***
  49.  
  50. The VEGX routines are "word-aligned"; that is they are optimized for
  51. the 286 CPU.  8088 CPU machines (PC's and XT's) will work just as
  52. fast, and 386 CPU's will work to nearly as fast as possible. 
  53.  
  54. VGXSave and VGXLoad were written in MASM assembly language and
  55. BASIC itself.  
  56.  
  57.  
  58. FILE FORMAT:
  59.  
  60. The first 48 bytes of a VEGX file contain the palette information.  Each
  61. of the 16 colors has a byte for red, blue and green, respectively.  Thus
  62. byte #1 is the red value for color 0, byte #6 is the green value for color
  63. 1, etc...
  64.  
  65. Following the 48-byte palette header is the compressed bank data.  Three
  66. flags (words or 2 bytes) are used to indicate runs or bank changes. These
  67. are:
  68.         893E  -  run of zeros follows
  69.         883E  -  run of ones follows
  70.         0F27  -  end of bank
  71.  
  72. The data is stored as words (2 bytes.)
  73.  
  74. The following is an example of the beginning of a VGX file which has a
  75. custom palette and red circle in the center of the screen:
  76.  
  77. 00 00 00 00 12 13 24 1C 1D 2D 21 1F 3F 2B 1F 3F \
  78. 38 20 3F 29 0A 3A 3A 0C 35 26 09 31 13 07 2C 05   >  palette header
  79. 07 28 02 12 23 01 1B 1C 00 1F 0E 00 1B 06 06 32 /
  80. 0F 27 0F 27 89 3E F3 15 01 FF FF C0 89 3E 25 00
  81.                                    
  82. skip bank 1 .     .     .     .     .     .
  83.            .     .     .     .     .     .
  84.       skip bank 2 .     .     .     .     .
  85.                  .     .     .     .     .
  86.             run of zeros next word  .     .
  87.                        .     .     .     .
  88.                   5619 words of zeros (decimal of F315)
  89.                              .     .     .
  90.                         01FF as bit pattern (= 0000000111111111)
  91.                                    .     .
  92.                               FFC0 as bit pattern
  93.                                          .
  94.                                     run of zeros next word
  95.                                           
  96.                                           37 words of zeros (dec. of 2500)
  97.  
  98.  
  99. 00 01 FE 00 00 3F C0 00 89 3E 24 00 00 3E 00 00    etc....
  100. 00 00 3E 00 89 3E 24 00 03 C0 00 00 00 00 01 E0
  101. 89 3E 24 00 1C 00 00 00 00 00 00 1C 89 3E 24 00...
  102.  
  103.  
  104.